<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
    <title>Module goo.textinput</title>
    <link rel="stylesheet" href="../luadoc.css" type="text/css" />
	<!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/-->
</head>

<body>
<div id="container">

<div id="product">
	<div id="product_logo"></div>
	<div id="product_name"><big><b></b></big></div>
	<div id="product_description"></div>
</div> <!-- id="product" -->

<div id="main">

<div id="navigation">


<h1>Goo</h1>
<ul>
	
	<li><a href="../index.html">Index</a></li>
	
</ul>


<!-- Module list -->

<h1>Modules</h1>
<ul>

	<li>
		<a href="../modules/anim.html">anim</a>
	</li>

	<li>
		<a href="../modules/goo.html">goo</a>
	</li>

	<li>
		<a href="../modules/goo.button.html">goo.button</a>
	</li>

	<li>
		<a href="../modules/goo.checkbox.html">goo.checkbox</a>
	</li>

	<li>
		<a href="../modules/goo.colorpick.html">goo.colorpick</a>
	</li>

	<li>
		<a href="../modules/goo.image.html">goo.image</a>
	</li>

	<li>
		<a href="../modules/goo.null.html">goo.null</a>
	</li>

	<li>
		<a href="../modules/goo.object.html">goo.object</a>
	</li>

	<li>
		<a href="../modules/goo.panel.html">goo.panel</a>
	</li>

	<li>
		<a href="../modules/goo.progressbar.html">goo.progressbar</a>
	</li>

	<li>
		<a href="../modules/goo.text.html">goo.text</a>
	</li>

	<li><strong>goo.textinput</strong></li>
	
</ul>



<!-- File list -->






</div><!-- id="navigation" -->

<div id="content">

<h1>Module <code>goo.textinput</code></h1>

<p>A box you can input text to. Supports all characters, lowercase and uppercase. Multiline text and caret movement.</p>







<h2>Functions</h2>
<table class="function_list">

	<tr>
	<td class="name" nowrap><a href="#goo.textinput:getCaretPos">goo.textinput:getCaretPos</a>&nbsp;()</td>
	<td class="summary">Get the position of the caret on the current line.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#goo.textinput:getLinePos">goo.textinput:getLinePos</a>&nbsp;()</td>
	<td class="summary">Get the line number the caret is on.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#goo.textinput:getMultiline">goo.textinput:getMultiline</a>&nbsp;()</td>
	<td class="summary">Get's if the textinput is in multiline mode </td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#goo.textinput:getText">goo.textinput:getText</a>&nbsp;()</td>
	<td class="summary">Get the text inside the textinput.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#goo.textinput:insert">goo.textinput:insert</a>&nbsp;(text, pos)</td>
	<td class="summary">Insert text on the current line at the specified position.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#goo.textinput:newline">goo.textinput:newline</a>&nbsp;(line_pos)</td>
	<td class="summary">Create a new line </td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#goo.textinput:onKeyReturn">goo.textinput:onKeyReturn</a>&nbsp;()</td>
	<td class="summary">Callback function called when the return key is pressed </td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#goo.textinput:onKeypressed">goo.textinput:onKeypressed</a>&nbsp;(key, unicode)</td>
	<td class="summary">Callback function when the key is pressed.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#goo.textinput:remove">goo.textinput:remove</a>&nbsp;(pos, length)</td>
	<td class="summary">Remove text on the current line at the specified position.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#goo.textinput:removeline">goo.textinput:removeline</a>&nbsp;(line_pos)</td>
	<td class="summary">Removes a line of text.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#goo.textinput:setCaretPos">goo.textinput:setCaretPos</a>&nbsp;(caretpos)</td>
	<td class="summary">Set the position of the caret on the current line </td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#goo.textinput:setLinePos">goo.textinput:setLinePos</a>&nbsp;(linepos)</td>
	<td class="summary">Sets the line position of the caret </td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#goo.textinput:setMultiline">goo.textinput:setMultiline</a>&nbsp;(multiline)</td>
	<td class="summary">Set the text input's multiline mode.</td>
	</tr>

	<tr>
	<td class="name" nowrap><a href="#goo.textinput:setText">goo.textinput:setText</a>&nbsp;(text)</td>
	<td class="summary">Sets the text of the box, new lines ignored if not multiline.</td>
	</tr>

</table>









<br/>
<br/>



<h2><a name="functions"></a>Functions</h2>
<dl class="function">



<dt><a name="goo.textinput:getCaretPos"></a><span>goo.textinput:</span><strong>getCaretPos</strong>&nbsp;(  )</dt>
<dd>
<p class="func_description">Get the position of the caret on the current line. <br/>The position is relative to the line it's on.</p>






<h3>Return value:</h3>
<p class="func_return">number: the position of the caret, 1 is first character.</p>



<h3>See also:</h3>
<ul>
	
	<li><a href="">
		goo.textinput:getLinePos
	</a>
	
	<li><a href="">
		goo.textinput:setCaretPos
	</a>
	
</ul>

</dd>




<dt><a name="goo.textinput:getLinePos"></a><span>goo.textinput:</span><strong>getLinePos</strong>&nbsp;(  )</dt>
<dd>
<p class="func_description">Get the line number the caret is on.</p>






<h3>Return value:</h3>
<p class="func_return">number: the line the caret is on, 1 is first line.</p>



<h3>See also:</h3>
<ul>
	
	<li><a href="">
		goo.textinput:setLinePos
	</a>
	
	<li><a href="">
		goo.textinput:getCaretPos
	</a>
	
</ul>

</dd>




<dt><a name="goo.textinput:getMultiline"></a><span>goo.textinput:</span><strong>getMultiline</strong>&nbsp;(  )</dt>
<dd>
<p class="func_description">Get's if the textinput is in multiline mode</p>








</dd>




<dt><a name="goo.textinput:getText"></a><span>goo.textinput:</span><strong>getText</strong>&nbsp;(  )</dt>
<dd>
<p class="func_description">Get the text inside the textinput.</p>






<h3>Return value:</h3>
<p class="func_return">string: the text.</p>



</dd>




<dt><a name="goo.textinput:insert"></a><span>goo.textinput:</span><strong>insert</strong>&nbsp;( text, pos )</dt>
<dd>
<p class="func_description">Insert text on the current line at the specified position.</p>

<h3>Parameters</h3>
<ul>
	
	
	<li>
	  <b>text</b> <i><small>:string</small></i><br/>the text to insert.
	</li>
	
	
	
	<li>
	  <b>pos</b> <i><small>:number</small></i><br/>the position to insert it at.
	</li>
	
	
</ul>








</dd>




<dt><a name="goo.textinput:newline"></a><span>goo.textinput:</span><strong>newline</strong>&nbsp;( line_pos )</dt>
<dd>
<p class="func_description">Create a new line</p>

<h3>Parameters</h3>
<ul>
	
	
	<li>
	  <b>line_pos</b> <i><small>:number</small></i><br/>the line number to add the newline after.
	</li>
	
	
</ul>








</dd>




<dt><a name="goo.textinput:onKeyReturn"></a><span>goo.textinput:</span><strong>onKeyReturn</strong>&nbsp;(  )</dt>
<dd>
<p class="func_description">Callback function called when the return key is pressed</p>








</dd>




<dt><a name="goo.textinput:onKeypressed"></a><span>goo.textinput:</span><strong>onKeypressed</strong>&nbsp;( key, unicode )</dt>
<dd>
<p class="func_description">Callback function when the key is pressed. <br/>this will not override the functionality of the text input, <br/>if you wish to override keypresses use goo.textinput:keypressed() instead.</p>

<h3>Parameters</h3>
<ul>
	
	
	<li>
	  <b>key</b> <i><small>:string</small></i><br/>the keyConstant of the key pressed.
	</li>
	
	
	
	<li>
	  <b>unicode</b> <i><small>:number</small></i><br/>the unicode value of the key pressed.
	</li>
	
	
</ul>








</dd>




<dt><a name="goo.textinput:remove"></a><span>goo.textinput:</span><strong>remove</strong>&nbsp;( pos, length )</dt>
<dd>
<p class="func_description">Remove text on the current line at the specified position.</p>

<h3>Parameters</h3>
<ul>
	
	
	<li>
	  <b>pos</b> <i><small>:number</small></i><br/>the position to start removing.
	</li>
	
	
	
	<li>
	  <b>length</b> <i><small>:number</small></i><br/>the number of character after pos to remove.
	</li>
	
	
</ul>








</dd>




<dt><a name="goo.textinput:removeline"></a><span>goo.textinput:</span><strong>removeline</strong>&nbsp;( line_pos )</dt>
<dd>
<p class="func_description">Removes a line of text.</p>

<h3>Parameters</h3>
<ul>
	
	
	<li>
	  <b>line_pos</b> <i><small>:number</small></i><br/>thr line number to remove.
	</li>
	
	
</ul>








</dd>




<dt><a name="goo.textinput:setCaretPos"></a><span>goo.textinput:</span><strong>setCaretPos</strong>&nbsp;( caretpos )</dt>
<dd>
<p class="func_description">Set the position of the caret on the current line</p>

<h3>Parameters</h3>
<ul>
	
	
	<li>
	  <b>caretpos</b> <i><small>:number</small></i><br/>the position of the caret, 1 is first character
	</li>
	
	
</ul>








<h3>See also:</h3>
<ul>
	
	<li><a href="">
		goo.textinput:setCaretPos
	</a>
	
</ul>

</dd>




<dt><a name="goo.textinput:setLinePos"></a><span>goo.textinput:</span><strong>setLinePos</strong>&nbsp;( linepos )</dt>
<dd>
<p class="func_description">Sets the line position of the caret</p>








</dd>




<dt><a name="goo.textinput:setMultiline"></a><span>goo.textinput:</span><strong>setMultiline</strong>&nbsp;( multiline )</dt>
<dd>
<p class="func_description">Set the text input's multiline mode.</p>

<h3>Parameters</h3>
<ul>
	
	
	<li>
	  <b>multiline</b> <i><small>:bool</small></i><br/>true to allow multiple lines, false to not.
	</li>
	
	
</ul>








</dd>




<dt><a name="goo.textinput:setText"></a><span>goo.textinput:</span><strong>setText</strong>&nbsp;( text )</dt>
<dd>
<p class="func_description">Sets the text of the box, new lines ignored if not multiline.</p>








<h3>See also:</h3>
<ul>
	
	<li><a href="">
		goo.textinput:setMultiline
	</a>
	
</ul>

</dd>


</dl>









</div> <!-- id="content" -->

</div> <!-- id="main" -->

<div id="about">
	<p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
</div> <!-- id="about" -->

</div> <!-- id="container" -->	
</body>
</html>
